#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <stdlib.h>

int main(int argc, char **argv) {
	int status;
	pid_t pid = fork();
	if (pid < 0) {
		printf("fork error\n");
		return -1;
	}
	if (0 == pid) {
		printf("This is the child process, pid is %d\n", getpid());
		sleep(1);
	}
	if (pid > 0) {
		printf("This is father process, pid is %d\n", getpid());
	}
	wait(&status);
	exit(EXIT_SUCCESS);
}
